package com.techsoul.module.pms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.techsoul.module.pms.pojo.entity.TbWmsLocation;
import com.techsoul.module.pms.pojo.param.TbWmsLocationSearchParam;
import com.techsoul.module.pms.pojo.vo.TbWmsLocationVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 库区Mapper接口
 * 
 * @author liuen
 * @date 2022-01-25
 */
public interface TbWmsLocationMapper extends BaseMapper<TbWmsLocation> {

    /**
     * 详情
     * @param id
     * @return
     */
    TbWmsLocationVo findById(String id);
    TbWmsLocation findByLocationNo(@Param("locationNo") String locationNo);
    List<TbWmsLocation>  findEmptyCanUse(@Param("pickupIndex") Integer pickupIndex);
    Double findRemainLoadEmptyCanUse(@Param("pickupIndex") Integer pickupIndex);
    List<TbWmsLocation> findSameMaterialLocations(@Param("materialNo") String materialNo,@Param("volume") Double volume);
    List<TbWmsLocation> findSameMaterialLocations(@Param("materialNo") String materialNo);
    /**
     * 列表
     * @param params
     * @return
     */
    List<TbWmsLocationVo> findAll(@Param("params") TbWmsLocationSearchParam params);

    /**
     * 分页
     * @param page
     * @param params
     * @return
     */
    IPage<TbWmsLocationVo> findAll(Page page, @Param("params") TbWmsLocationSearchParam params);
    IPage<TbWmsLocation>  findAllEntity(Page page, @Param("params") TbWmsLocationSearchParam params);
    List<TbWmsLocation>  findAllEntity2(@Param("params") TbWmsLocationSearchParam params);
}
